﻿using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Domain.Entities;

namespace AbpToDomain.EntityInfo
{
    //物料
    public class MaterialBase : Entity
    {
        [Key]
        public Guid Id_Materialbase { get; set; }
        public DateTime CreatedDate { get; set; }
        public string MaterialName { get; set; }
        public string MaterialCode { get; set; }
        
        [Comment("物料大小")]
        public string? Size {  get; set; }
        [Comment("1个单位物料数量")]
        public int? Quantity { get; set; }
        [Comment("单位")]
        public string? Unit { get; set; }
        [Comment("类型")]
        public string? Type { get; set; }
        [Comment("说明")]
        public string? Description { get; set; }
        public bool? IsDelete {  get; set; }
   
        public string? Info {  get; set; }
        //foreign key     
        public Guid? Id_BoxPosition {  get; set; }
        public BoxPosition? BoxPosition { get; set; }
        public List<MaterialOrder>? materialOrders { get; set; }=new List<MaterialOrder>();
        public override object[] GetKeys()
        {
            return new object[] { Id_Materialbase };
        }
        //function
        public MaterialBase AddMaterialBase(string Size, int? Quantity, string? Unit, string? Type,            
                                      string? Description, bool? IsDelete, string State)
        {
            MaterialBase materialBase = new MaterialBase();
            materialBase.MaterialCode = "qqw";
            materialBase.Size = Size;
            materialBase.MaterialName = "asd";
            materialBase.Quantity = Quantity;
            materialBase.Unit = Unit;
            materialBase.Type = Type;
            materialBase.Description = Description;
            materialBase.IsDelete = IsDelete;        
            return materialBase;
        }

        public MaterialBase() 
        {
           
        }
    }
}
